package com.lanyanhua.job.entity;

import lombok.Data;

/**
 * @Auther: lanyanhua
 * @Date: 2018/10/25 0018 14:58
 * @Description: layui table 返回数据
 */
@Data
public class Page {
    //解析接口状态 0为有数据
    private Integer code;
    //解析提示文本
    private String msg;
    //解析数据长度
    private Long count;
    //解析数据列表
    private Object data;

    public Page(Long count, Object data) {
        this();
        this.count = count;
        this.data = data;
    }

    public Page(org.springframework.data.domain.Page pageInfo) {
        this();
        this.data = pageInfo.getContent();
        this.count = pageInfo.getTotalElements();
    }

    public Page(String msg) {
        this.code = 1;
        this.msg = msg;
    }

    public Page() {
        this.code = 0;
    }

}
